import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Home',
        component: Home,
        children:[
            {path:'/',meta:{auth:true},component:()=>import('@/pages/home/index.vue')},
            {path:'article',meta:{auth:true},component:()=>import('@/pages/article/index.vue')},
            {path:'articlelist',meta:{auth:true},component:()=>import('@/pages/articlelist/index.vue')},
            {path:'news',meta:{auth:true},   component:()=>import('@/pages/news/index.vue')},
            {path:'product',meta:{auth:true},   component:()=>import('@/pages/product/index.vue')},
            {path:'add_news',meta:{auth:true}, component:()=>import('@/pages/articlelist/add_news.vue')}
        ]
    },
    {
        path: '/about',
        name: 'About',
        component: () => import('@/views/About.vue')
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('@/views/Login.vue')
    },

]

const router = new VueRouter({
    routes
})

export default router